home *** CD-ROM | disk | FTP | other *** search
/ 64'er 1986 May / 64er_Magazin_86-05_1986_Markt__Technik_de.d64 / pg-quell 1 (.txt) < prev    next >
Commodore BASIC  |  2022-10-26  |  7KB  |  280 lines

  1. 990 open1,4
  2. 995 sys 9*4096
  3. 1000 .opt oo,p1
  4. 1005 ;
  5. 1010 ;grafikroutinen 'profi-grafik 64'
  6. 1015 ;
  7. 1020 *= $8390           ;startadresse
  8. 1025 ;
  9. 1030 getcom   = $aefd ;prueft auf komma
  10. 1035 getbyte  = $b79e ;holt byte ins x-register
  11. 1040 getadr   = $b7eb ;adresswert nach $14/$15 + getbyte
  12. 1045 chrget   = $0073 ;holt naechstes zeichen
  13. 1050 chr(NULL)t   = $0079 ;holt letztes zeichen
  14. 1055 illegal  = $b248 ;fehlermeldung 'illegal quantity'
  15. 1060 ;
  16. 1065 scrnum   = $9ff1 ;aktuelle bildschirmnummer
  17. 1070 ;
  18. 1075 screen jsr getbyte
  19. 1080 cpx #2
  20. 1085 bcc scrok
  21. 1090 jmp illegal
  22. 1095 scrok lda scrtab,x
  23. 1100 sta scrnum       ;merken
  24. 1105 rts
  25. 1110 ;
  26. 1115 scrtab .byt $a0,$e0
  27. 1120 ;
  28. 1125 hires lda $dd00        ;16k-bereich,den der vic adressiert
  29. 1130 and #%11111100   ;festlegen $c000-$ffff
  30. 1135 bit scrnum
  31. 1140 bvs *+4          ;bei $e0 ist das v-flag gesetzt !
  32. 1145 ora #%00000001   ;bereich von $8000-$bfff
  33. 1150 sta $dd00
  34. 1155 lda $d018        ;position des videorams
  35. 1160 ora #%00101000   ;festlegen $0c00-$0fff
  36. 1165 sta $d018
  37. 1170 jsr tex1
  38. 1175 lda $d011        ;einzelpunktmodus einschalten
  39. 1180 ora #%00100000   ;bit5=1
  40. 1185 sta $d011
  41. 1190 rts
  42. 1195 ;
  43. 1200 multi jsr hires        ;hires-modus ein
  44. 1205 lda $d016        ;multicolormodus einschalten
  45. 1210 ora #%00010000   ;bit4=1
  46. 1215 sta $d016
  47. 1220 rts
  48. 1225 ;
  49. 1230 text lda $dd00        ;vic adressiert jetzt wieder
  50. 1235 ora #%00000011   ;bereich von $0000-$3fff
  51. 1240 sta $dd00
  52. 1245 lda $d018        ;videoram ab $0400-$07ff
  53. 1250 and #%11010111
  54. 1255 sta $d018
  55. 1260 lda $d011        ;einzelpunktmodus abschalten
  56. 1265 and #%11011111
  57. 1270 sta $d011
  58. 1275 tex1 lda $d016        ;multicolormodus abschalten
  59. 1280 and #%11101111
  60. 1285 sta $d016
  61. 1290 rts
  62. 1295 ;
  63. 1300 help = $20          ;hilfszeiger
  64. 1305 ;
  65. 1310 clear lda scrnum
  66. 1315 sta help+1
  67. 1320 lda #0
  68. 1325 sta help         ;zeiger auf anfang der bitmap
  69. 1330 tay
  70. 1335 ldx #32          ;32 bloecke = 8 kbyte
  71. 1340 cloop sta (help),y     ;byte loeschen
  72. 1345 iny
  73. 1350 bne cloop
  74. 1355 inc help+1       ;naechster block
  75. 1360 dex
  76. 1365 bne cloop
  77. 1370 rts
  78. 1375 ;
  79. 1380 hicol jsr getbyte      ;zeichenfarbe holen
  80. 1385 stx help         ;merken
  81. 1390 jsr getcom
  82. 1395 jsr getbyte      ;hintergrundfarbe
  83. 1400 stx help+1       ;merken
  84. 1405 lda help         ;zeichenfarbe
  85. 1410 asl a
  86. 1415 asl a            ;mal 16
  87. 1420 asl a
  88. 1425 asl a
  89. 1430 clc
  90. 1435 adc help+1       ;+ hintergrundfarbe
  91. 1440 jsr hic1         ;mit diesem wert videoram fuellen
  92. 1445 jsr chr(NULL)t
  93. 1450 cmp #","         ;wenn noch ein komma folgt,
  94. 1455 bne mode-1
  95. 1460 jsr chrget
  96. 1465 jsr getbyte      ;dann 3.zeichenfarbe holen
  97. 1470 txa
  98. 1475 ldx #$d8         ;und das farbram ($d800-$dfff)
  99. 1480 bne hic2         ;damit fuellen
  100. 1485 ;
  101. 1490 hic1 bit scrnum
  102. 1495 bvs scr1a
  103. 1500 ldx #$8c         ;screen0 videoram von $8c00-$8fff
  104. 1505 .byt $2c          ;bit-opcode
  105. 1510 scr1a ldx #$cc         ;screen1 videoram von $cc00-$cfff
  106. 1515 hic2 stx help+1
  107. 1520 ldy #0
  108. 1525 sty help         ;zeiger auf anfang videoram
  109. 1530 ldx #4           ;4 bloecke sind zu fuellen
  110. 1535 hloop sta (help),y
  111. 1540 iny
  112. 1545 bne hloop
  113. 1550 inc help+1       ;naechster block
  114. 1555 dex
  115. 1560 bne hloop
  116. 1565 rts
  117. 1570 ;
  118. 1575 plotmode = $9ff2        ;aktueller plotmodus
  119. 1580 ;
  120. 1585 mode jsr getbyte
  121. 1590 cpx #3
  122. 1595 bcc modeok
  123. 1600 illmode jmp illegal
  124. 1605 modeok lda modetab,x
  125. 1610 sta plotmode     ;modus merken
  126. 1615 rts
  127. 1620 ;
  128. 1625 modetab .byt 0,64,128
  129. 1630 ;
  130. 1635 multicol = $9ff3        ;zeichenfarbe fuer multi
  131. 1640 ;
  132. 1645 ink jsr getbyte      ;zeichenfarbe setzen
  133. 1650 cpx #4
  134. 1655 bcs illmode      ;>=4, dann fehler
  135. 1660 stx multicol     ;merken
  136. 1665 rts
  137. 1670 ;
  138. 1675 xlo = $14
  139. 1680 xhi = $15
  140. 1685 ;
  141. 1690 ;bytenummer errechnen (hires-modus)
  142. 1695 hiplot lsr       ;y-koord. schon im akku !
  143. 1700 lsr              ;(y/8)
  144. 1705 lsr
  145. 1710 tay              ;ins y-register
  146. 1715 clc              ;alle lobytes addieren
  147. 1720 txa
  148. 1725 and #%00000111   ;(y and #7)
  149. 1730 adc maltab,y     ;+ (320*y/8)lo (c=0!)
  150. 1735 sta $f7
  151. 1740 lda xlo
  152. 1745 and #%11111000   ;+ (xlo and #248)
  153. 1750 adc $f7
  154. 1755 sta $f7          ;nach $f7
  155. 1760 ;addition der hibytes
  156. 1765 lda maltab1,y    ;(320*y/8)hi
  157. 1770 adc scrnum       ;+ anfang bitmap
  158. 1775 adc xhi          ;+ xhi
  159. 1780 sta $f8          ;nach $f8
  160. 1785 lda xlo          ;bitposition errechnen
  161. 1790 and #%00000111   ;(xlo and #7)
  162. 1795 tay
  163. 1800 lda hochtab,y    ;2^(7-yregister)
  164. 1805 rts
  165. 1810 ;
  166. 1815 muplot lsr             ;(y/8)
  167. 1820 lsr
  168. 1825 lsr
  169. 1830 tay
  170. 1835 lda xlo
  171. 1840 and #%11111100   ;(xlo and #252)
  172. 1845 asl                    ;mal 2 (bit7 ins carry !)
  173. 1850 sta $f7          ;nach $f7
  174. 1855 lda maltab1,y    ;(320*y/8)hi
  175. 1860 adc scrnum       ;+anfang bitmap
  176. 1865 sta $f8          ;nach $f8
  177. 1870 txa
  178. 1875 and #%00000111   ;(y and #7)
  179. 1880 adc maltab,y     ;+(320*y/8)lo
  180. 1885 tay              ;ins y-register
  181. 1890 lda xlo          ;bitposition errechnen
  182. 1895 and #%00000011   ;(xlo and #3)
  183. 1900 tax
  184. 1905 lda multab,x     ;bitwert laden
  185. 1910 sec
  186. 1915 rts
  187. 1920 ;
  188. 1925 plot jsr getadr       ;koordinaten holen
  189. 1930 lda $d016
  190. 1935 and #%00010000
  191. 1940 bne mplot        ;multicolormodus
  192. 1945 cpx #200
  193. 1950 bcs plot-1       ;ykoord.>199 (c=1)
  194. 1955 ldy xhi
  195. 1960 beq ok
  196. 1965 dey
  197. 1970 bne plot-2       ;xhi>1 (c=1)
  198. 1975 lda xlo          ;xhi=1, dann xlo testen
  199. 1980 cmp #<320
  200. 1985 bcs plot-1       ;xlo>$40 (c=1)
  201. 1990 ok sei
  202. 1995 lda #$34         ;speicher auf ram umschalten
  203. 2000 sta 1            ;um bit-map lesen zu koennen
  204. 2005 txa
  205. 2010 pha              ;y-koord. merken
  206. 2015 jsr hiplot       ;bytenummer berechnen
  207. 2020 ldy #0
  208. 2025 bit plotmode
  209. 2030 bvs loesch
  210. 2035 bmi invert
  211. 2040 ora ($f7),y      ;punkt setzen
  212. 2045 bne store        ;unbedingter sprung
  213. 2050 ;
  214. 2055 mplot cpx #200
  215. 2060 bcs plot-1
  216. 2065 lda xhi          ;xhi<>0 (c=1)
  217. 2070 bne plot-2
  218. 2075 lda xlo
  219. 2080 cmp #160
  220. 2085 bcs plot-2       ;xlo>159 (c=1)
  221. 2090 sei
  222. 2095 lda #$34         ;speicher auf ram umschalten
  223. 2100 sta 1
  224. 2105 txa
  225. 2110 pha              ;ykoord. merken
  226. 2115 jsr muplot       ;bytenummer errechnen
  227. 2120 bit plotmode
  228. 2125 bvs loesch
  229. 2130 bmi invert
  230. 2135 pha              ;punkt setzen
  231. 2140 eor #255         ;vorher loeschen
  232. 2145 and ($f7),y
  233. 2150 sta ($f7),y
  234. 2155 ldx multicol     ;zeichenfarbe laden
  235. 2160 pla
  236. 2165 and multab1,x    ;bitmuster der farbe setzen
  237. 2170 ora ($f7),y
  238. 2175 bne store
  239. 2180 loesch eor #255         ;punkt loeschen
  240. 2185 and ($f7),y
  241. 2190 .byt $2c
  242. 2195 invert eor ($f7),y      ;punkt invertieren
  243. 2200 store sta ($f7),y      ;bitmuster setzen
  244. 2205 pla              ;ykoord. wiederherstellen
  245. 2210 tax
  246. 2215 plotend lda #$37         ;normale speicherkonfiguration
  247. 2220 sta 1
  248. 2225 cli
  249. 2230 clc                    ;c=0 wenn punkt gesetzt
  250. 2235 rts
  251. 2240 ;
  252. 2245 maltab .byt 0,<320,<640,<960 ;multiplikationstabelle
  253. 2250 .byt $00,$40,$80,$c0  ;mal 320
  254. 2255 .byt $00,$40,$80,$c0  ;lobytes
  255. 2260 .byt $00,$40,$80,$c0
  256. 2265 .byt $00,$40,$80,$c0
  257. 2270 .byt $00,$40,$80,$c0
  258. 2275 .byt $00
  259. 2280 ;
  260. 2285 maltab1 .byt 0,>320,>640,>960
  261. 2290 .byt $05,$06,$07,$08  ;mal 320
  262. 2295 .byt $0a,$0b,$0c,$0d  ;hibytes
  263. 2300 .byt $0f,$10,$11,$12
  264. 2305 .byt $14,$15,$16,$17
  265. 2310 .byt $19,$1a,$1b,$1c
  266. 2315 .byt $1e
  267. 2320 ;
  268. 2325 hochtab .byt $80,$40,$20,$10 ;zweierpotenzen
  269. 2330 .byt $08,$04,$02,$01
  270. 2335 ;
  271. 2340 multab .byt %11000000    ;xposition0
  272. 2345 .byt %00110000    ;xposition1
  273. 2350 .byt %00001100    ;xposition2
  274. 2355 .byt %00000011    ;xposition3
  275. 2360 ;
  276. 2365 multab1 .byt %00000000    ;farbe0=hintergrund
  277. 2370 .byt %01010101    ;farbe1
  278. 2375 .byt %10101010    ;farbe2
  279. 2380 .byt %11111111    ;farbe3
  280.